win32: Never pass SWP_NOSIZE or SWP_NOMOVE to SetWindowPos
authorNeil Roberts <neil@linux.intel.com>
Thu, 26 Aug 2010 18:02:00 +0000 (19:02 +0100)
committerAlexander Larsson <alexl@redhat.com>
Thu, 10 Nov 2011 16:40:47 +0000 (17:40 +0100)
In _gdk_window_move_resize_child it tries to decide whether to pass
SWP_NOSIZE and SWP_NOMOVE based on whether the new size and position
is different from the window's existing position. However it seems
that GDK now ends up updating the window's position before calling
_gdk_window_move_resize_child so this would mean it would think the
window never changes size or position so SWP_NOSIZE|SWP_NOMOVE would
always be set. This causes child windows to never be resized.

This patch changes it so that it never passes either flag to
SetWindowPos. I don't know whether this will cause any side effects
but you'd think it shouldn't do any harm to reassert the current size.

https://bugzilla.gnome.org/show_bug.cgi?id=628049

Signed-off-by: Hans Breuer <hans@breuer.org>
gdk/win32/gdkgeometry-win32.c

index c16920886eda9e5dd04eb336b38049a659af3094..10b987151be09b6d9257f9a75748811f5be7a59b 100644 (file)
@@ -59,17 +59,12 @@ _gdk_window_move_resize_child (GdkWindow *window,
                               gint       height)
 {
   GdkWindowImplWin32 *impl;
-  gboolean is_move;
-  gboolean is_resize;
 
   g_return_if_fail (window != NULL);
   g_return_if_fail (GDK_IS_WINDOW (window));
 
   impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
 
-  is_move = (x - window->x != 0) && (y - window->y != 0);
-  is_resize = window->width != width && window->height != height;
-  
   GDK_NOTE (MISC, g_print ("_gdk_window_move_resize_child: %s@%+d%+d %dx%d@%+d%+d\n",
                           _gdk_win32_window_description (window),
                           window->x, window->y, width, height, x, y));
@@ -93,19 +88,15 @@ _gdk_window_move_resize_child (GdkWindow *window,
   _gdk_win32_window_tmp_unset_bg (window, TRUE);
   
   GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,%d,%d,"
-                          "NOACTIVATE|NOZORDER%s%s)\n",
+                          "NOACTIVATE|NOZORDER)\n",
                           GDK_WINDOW_HWND (window),
                           window->x + window->parent->abs_x, window->y + window->parent->abs_y, 
-                          width, height,
-                          (is_move ? "" : "|NOMOVE"),
-                          (is_resize ? "" : "|NOSIZE")));
+                          width, height));
 
   API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), NULL,
                           window->x + window->parent->abs_x, window->y + window->parent->abs_y, 
                           width, height,
-                          SWP_NOACTIVATE | SWP_NOZORDER | 
-                          (is_move ? 0 : SWP_NOMOVE) |
-                          (is_resize ? 0 : SWP_NOSIZE)));
+                          SWP_NOACTIVATE | SWP_NOZORDER));
 
   _gdk_win32_window_tmp_reset_bg (window, TRUE);
 }